Add Process Listing and Attach by PID to Autosplitting API#721
Merged
CryZe merged 6 commits intoLiveSplit:masterfrom Oct 1, 2023
Merged
Add Process Listing and Attach by PID to Autosplitting API#721CryZe merged 6 commits intoLiveSplit:masterfrom
CryZe merged 6 commits intoLiveSplit:masterfrom
Conversation
Collaborator
|
Some early thoughts:
|
Contributor
Author
I'll get to making modifications soon |
Collaborator
|
I've made some changes locally, let me push them first. I'll get to it after work. |
Contributor
Author
|
Hey, I wanted to double check the status of this. Have you made more progress on that work? |
… API This allows for users to list all process pids matching a name and then attach to processes using those pids for when custom picking logic is needed for processes.
…y converting u32 pid to Pid type
c2ab4d9 to
6ecc4f0
Compare
Collaborator
|
Alright, I made all these changes. The PID is u64 now, just to be safe. And an error is still returned in case process listing would return an error (which also is just to be safe, because |
6ecc4f0 to
cbe2a34
Compare
cbe2a34 to
84472e0
Compare
CryZe
added a commit
to LiveSplit/asr
that referenced
this pull request
Oct 1, 2023
Adds two functions: `Process::attach_by_pid` attaches to a process by referencing its PID. `Process::list_by_name` / `Process::list_by_name_into` lists all PIDs associated with processes with the name passed in. Together, these allow an autosplitter to define its own logic for discovering and attaching to processes. Sometimes start time or largest PID don't quite get the right process. For example, Tony Hawk's Pro Skater 1+2 has a bootstrap and game process, both with the same name. They start in the same second, so the regular `Process::attach` logic often selects the incorrect process. This pull request allows an author to check each process closer to determine which one is desired. (rather messy) example of usage here: https://github.com/PARTYMANX/thps-autosplitter/blob/thps12-disambiguate/src/lib.rs#L19 Companion pull request to LiveSplit/livesplit-core#721. Solves #50. Co-authored-by: Christopher Serr <christopher.serr@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two functions to the API:
process_attach_pidattaches to a process by referencing its PID.process_listlists all PIDs associated with processes with the name passed in.Together, these allow an autosplitter to define its own logic for discovering and attaching to processes.
Sometimes start time or largest PID don't quite get the right process. For example, Tony Hawk's Pro Skater 1+2 has a bootstrap and game process, both with the same name. They start in the same second, so the regular
process_attachlogic often selects the incorrect process. This pull request allows an author to check each process closer to determine which one is desired.